// 动画效果
<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition name="h1" appear>
      // appear(出现)
      <h1 v-show="isShow">你好呀!</h1>
    </transition>
  </div>
</template>

<script>
export default {
  name: "my-test",
  data() {
    return {
      isShow: true,
    };
  },
};
</script>

<style scoped>
h1 {
  background-color: orange;
}

.h1-enter-active {
  animation: atguigu 0.5s linear;
}

.h1-leave-active {
  animation: atguigu 0.5s linear reverse;
}

@keyframes atguigu {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0%);
  }
}
</style>
